$(document).ready(function() {
	// 点击登录
	$("#login").click(function() {
		var email = $("#email").val();
		var password = $("#password").val();

		// 登录
		var url = "/user/login/" + email + "/" + password;
		syncGet(url,
			function(data) {
				if (data) {
					$(location).attr("href", "welcome.html");
				}
			},
			function() {
				alert("用户名或密码错误！");
			});
	});

	// 点击注册
	$("#regist").click(function() {
		$(location).attr("href", "register.html");
	});
});
